﻿ @model IEnumerable<Chilis.Caja.Web.Models.CajaCajTur>
           @{
    ViewBag.Title = "Cajas";
    Layout = "~/Views/Shared/_Layout.cshtml";
     
}

<script language="javascript">
    function jsEliminar(valor) {

        var r = confirm('¿Esta seguro de eliminar el registro seleccionado?');
        if (r == true) {
            window.location.href = "/Caja/EliminarCaja?idCaja=" + valor;
        } else {
            return false;
        }

    }

    function jsBuscar() {

        if (document.frmCajas.txtidcaja.value == '') {
            alert('Ingrese el código de caja');
            document.frmCajas.txtidcaja.focus();
            return false;
        }

        document.frmCajas.submit();
    }
</script>


<h1>Cajas </h1>


 
   
 
 
<table >
<tr>
<td>
  @using (Html.BeginForm("BuscarCaja", "Caja", FormMethod.Post, new { name = "frmCajas", id = "frmCajas", @class = "well" }))
     {   
<table>
 <tr> 
  <td>Código Caja </td>
  <td> <input id="txtidcaja" name="txtidcaja" type="text" value=""/></td>  
  <td>          
        
               
      <button type="button" class="button aceptar" onclick="jsBuscar()">
          Buscar
       </button>   
        
                      </td>
  
   <td>      &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;    &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;    &nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;     &nbsp;&nbsp;&nbsp;     &nbsp;&nbsp;&nbsp; </td>
    <td><a href="/Caja/VerFormRegCaja" onclick="">Agregar</a>  </td>
 
 </tr> 

</table> 
 }



</td>
</tr>

<tr>
<td>
<table class="mGrid" cellpadding="0" cellspacing="0" border="0" style="margin-left: 0px;
                        width: 690px;">
                        <thead>
                            <tr>
                                <th style="width: 80px;">
                                    Código Caja
                                </th>
                                <th style="width: 150px;">
                                    Descripción
                                </th>
                                 <th style="width: 80px;">
                                    Turno
                                </th>                      
                                 <th style="width: 80px;">
                                    Cajero
                                </th>   
                                <th style="width: 80px;">
                                    Opciones
                                </th>
                            </tr>
                        </thead>
                    <tbody  >
                        @{
                            foreach (Chilis.Caja.Web.Models.CajaCajTur oCajaCajTur in Model)
                            {  
                            <tr>
                                <td>
                                    @oCajaCajTur.IdCaja
                                </td>
                                <td>
                                    @oCajaCajTur.NombreCaja
                                </td>

                                 <td>
                                    @oCajaCajTur.IdTurno
                                   </td> 
                                     <td>
                                     @oCajaCajTur.IdCajero
                                   </td>
                        
                                <td>
                                    <a  href="/Caja/ObteneCaja?idCaja=@oCajaCajTur.IdCaja"  onclick="">Modificar</a>
                                    &nbsp;&nbsp;&nbsp;
                                    <a href="javascript:jsEliminar('@oCajaCajTur.IdCaja');" onclick="">Eliminar</a>
                              
                                </td>
                            </tr>
                            }
                        }
                    </tbody>
                </table>
</td>
</tr>

</table>

                    


